package com.nehc.nettyserver.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * 文件存储配置
 * 
 * @author NEHC
 * @date 2023-04-02
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "spring.storage")
public class StorageConfig {
    
    /**
     * 存储位置
     */
    private String location = "./data";
    
    /**
     * 存储类型：json, xml
     */
    private String type = "json";
    
    /**
     * 备份配置
     */
    private Backup backup = new Backup();
    
    @Data
    public static class Backup {
        /**
         * 是否启用备份
         */
        private boolean enabled = true;
        
        /**
         * 备份间隔(毫秒)
         */
        private long interval = 3600000; // 默认1小时
    }
} 